home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / mtgrap1c / demo9.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-13  |  2.2 KB  |  100 lines

  1. /*                                                            
  2.   ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  3.   ▒                                                          ▒
  4.   ▒                                                          ▒
  5.   ▒             Neuromancer's Graphics Library               ▒
  6.   ▒                     Version 1.0c                         ▒
  7.   ▒                                                          ▒
  8.   ▒    This example illustrates the copyblock routine.       ▒
  9.   ▒    This allows a block to be copied from src to dest     ▒
  10.   ▒    If src and dest overlap, checks will be performed     ▒
  11.   ▒    to ensure that transfer is done correctly.            ▒
  12.   ▒                                                          ▒ 
  13.   ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  14.   ▒                                                          ▒
  15.   ▒     Project:    MTLIB01.LIB                              ▒
  16.   ▒                 DEMO9.CPP                                ▒
  17.   ▒                                                          ▒ 
  18.   ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  19. */
  20.  
  21. #include <iostream.h>
  22. #include <stdlib.h>
  23. #include <conio.h>
  24. #include <dos.h>
  25. #include "video.h"
  26. #include "bitmap.h"
  27.  
  28. block page1;
  29.  
  30. void main(void)
  31. {
  32.     int xcor;    
  33.     int ycor;
  34.     
  35.     int xcor1;
  36.     int ycor1;
  37.  
  38.     int xdir;
  39.     int ydir;
  40.  
  41.     int xdir1;
  42.     int ydir1;
  43.     
  44.     mtSetVGAMode();            //Set up VGA Mode
  45.     mtClrScr(0);
  46.  
  47.     if ((page1=mtAllocPage(0,0,319,199))==NULL)
  48.     {
  49.         mtSetTextMode();
  50.         cout << "Error setting up Page1"<<endl;
  51.     }
  52.  
  53.     mtSetPage(PAGE_1);
  54.     mtClrScr(45);
  55.     
  56.     mtSetPage(PAGE_0);
  57.     mtSetWindow(0,0,319,199);
  58.     
  59.     mtWaitRetrace();
  60.     mtLoadPCX("screen1.dat");
  61.  
  62.     if (mtCopyBlk(10,10,100,100,100,10,PAGE_0,PAGE_0)==1)
  63.     {
  64.         mtFreePage(PAGE_1);
  65.         mtSetTextMode();
  66.         cout <<"Error!!!"<<endl;
  67.         exit(0);
  68.     }
  69.  
  70.     if (mtCopyBlk(10,20,120,190,10,10,PAGE_0,PAGE_1)==1)
  71.     {
  72.         mtFreePage(PAGE_1);
  73.         mtSetTextMode();
  74.         cout <<"Error!!!"<<endl;
  75.         exit(0);
  76.     }
  77.  
  78.     getch();
  79.  
  80.     mtFlipPage(PAGE_1);
  81.  
  82.     getch();
  83.  
  84.     mtFreePage(PAGE_1);
  85.     
  86.     mtSetTextMode();
  87.  
  88.     cout << "Thank you for using the library!" << endl;
  89.  
  90.     exit(0);
  91.     
  92. }
  93.  
  94.            
  95.             
  96.  
  97.            
  98.  
  99.            
  100.